//
//  QXAdvertManager.h
//  iAccountBook
//
//  Created by 侯伟 on 2021/9/5.
//

#import <Foundation/Foundation.h>
#import "QXConfig.h"

NS_ASSUME_NONNULL_BEGIN

@protocol QXAdvertDelegate <NSObject>

@optional
// 获取广告类型
- (void)QXAdTypeDidLoaded:(ADType)adType success:(BOOL)success;

//加载失败
- (void)QXAdLoadFaild:(ADType)adType adChannel:(ADChannel)adChannel error:(NSError *_Nullable)error;

//无法显示
- (void)QXAdDisplayFaild:(ADType)adType adChannel:(ADChannel)adChannel error:(NSError *_Nullable)error;

//关闭
- (void)QXAdDidClosed:(ADType)adType adChannel:(ADChannel)adChannel ad:(id _Nullable )ad;

//加载成功
- (void)QXAdDidLoaded:(ADType)adType adChannel:(ADChannel)adChannel ad:(id _Nullable )ad;

//成功显示
- (void)QXAdDidDisplayed:(ADType)adType adChannel:(ADChannel)adChannel ad:(id _Nullable )ad;

//点击广告
- (void)QXAdDidClicked:(ADType)adType adChannel:(ADChannel)adChannel ad:(id _Nullable )ad;

@end

@interface QXAdvertManager : NSObject

@property(nonatomic,weak)id<QXAdvertDelegate>  delegate;

+ (QXAdvertManager *)manager;

/// 初始化广告
/// @param channel 渠道
/// @param appId appid
/// @param sAdId 闪屏广告id
/// @param vAdId 全屏视频广告id
/// @param bAdid banner广告id
- (void)initSDKWithChannel:(ADChannel)channel appId:(NSString*)appId sAdId:(NSString* _Nullable)sAdId vAdId:(NSString* _Nullable)vAdId bAdid:(NSString* _Nullable)bAdid;


/// 加载启动广告
- (void)loadSplashAdWithRootViewController:(UIViewController*)rootViewController;

/// 加载视频广告
- (void)loadVideoAdWithRootViewController:(UIViewController*)rootViewController;

/// 加载Banner广告
- (void)loadBannerAdWithRootViewController:(UIViewController*)rootViewController superView:(UIView*)bannerView;


@end

NS_ASSUME_NONNULL_END
